<template>
  <el-table
    :data="reset"
    border
    @selection-change="handleSelectionChange"
    style="width: 100%"
    :header-cell-style="{background:'#f4f4f4'}">
    <el-table-column 
      fixed 
      type="selection"
      align="center"
      width="50">
    </el-table-column>
    <!-- <el-table-column
      prop="TechId"
      align="center"
      label="ID"
      width="50">
    </el-table-column> -->
    <el-table-column
      type="index"
      :index="indexMethod"
      align="center"
      label="序号"
      width="50">
    </el-table-column>
    <el-table-column
      prop="Name"
      align="center"
      :show-overflow-tooltip="true" 
      label="工序简称">
    </el-table-column>
    <el-table-column
      prop="Description"
      align="center"
      :show-overflow-tooltip="true" 
      label="描述">
    </el-table-column>
    <el-table-column
      prop=".."
      align="center"
      label="工艺段">
    </el-table-column>
    <el-table-column
      prop="TechTypeName"
      align="center"
      :show-overflow-tooltip="true" 
      label="工序类型">
    </el-table-column>
    <el-table-column
      prop=".."
      align="center"
      label="模板">
    </el-table-column>
    <el-table-column
      prop="IsEnableFormat"
      align="center"
      label="状态">
    </el-table-column>
    <el-table-column
      prop="CreateByFormat"
      :show-overflow-tooltip="true"
      align="center"
      label="创建人">
    </el-table-column>
    <el-table-column
      prop="CreateTime"
      align="center"
      :show-overflow-tooltip="true" 
      label="创建时间">
    </el-table-column>
    <el-table-column
      prop="LastModifyByFormat"
      :show-overflow-tooltip="true" 
      align="center"
      label="修改人">
    </el-table-column>
    <el-table-column
      prop="LastModifyTime"
      align="center"
      :show-overflow-tooltip="true" 
      label="修改时间">
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    reset: {
      type: Array
    }
  },
  data() {
    return {
      
    }
  },
  methods:{
    handleSelectionChange(val){
      this.$emit('changeData',val)
      let listId=[]
      val.forEach(el => {
          listId.push(el.TechId)
      });
      this.$emit('getId',listId)   
      let listName=[]
      val.forEach(el => {
          listName.push(el.Name)
      }); 
      this.$emit('getName',listName)        
    },
    indexMethod(index){
      return (index+1)+(this.$parent.currentPage-1)*this.$parent.size
    },
  }
}
</script>
